//Block 1: Identify Hardpoint
var hardpoint = 0;

if keyboard_check_pressed(ord('Z')) 
hardpoint = 0;
if keyboard_check_pressed(ord('X'))
hardpoint = 1;
if keyboard_check_pressed(ord('C'))
hardpoint = 5;
if keyboard_check_pressed(ord('V'))
hardpoint = 3;

//Block 2: Set line of fire
var fireside = (hardpoint + objHeroOW.image_index) % 6;

var range = 2
var clicks = 0.5

if fireside == 0 
{
    for (i=1; i<=range; i++)
    {
        with(instance_create(x+(32*i),y,objHit))
        {
            for (j=1; j<=floor(clicks); j++)
            {
                instance_create(x-(16*j),y-(24*j),objHit);
                instance_create(x-(16*j),y+(24*j),objHit);
            }
        }
        clicks+=0.5;
    }
}
if fireside == 1 
{
    for (i=1; i<=range; i++)
    {
        with(instance_create(x+(16*i),y-(24*i),objHit))
        {
            for (j=1; j<=floor(clicks); j++)
            {
                instance_create(x-(32*j),y,objHit);
                instance_create(x+(16*j),y+(24*j),objHit);
            }
        }
        clicks+=0.5;
    }
}
if fireside == 2 
{
    for (i=1; i<=range; i++)
    {
        with(instance_create(x-(16*i),y-(24*i),objHit))
        {
            for (j=1; j<=floor(clicks); j++)
            {
                instance_create(x+(32*j),y,objHit);
                instance_create(x-(16*j),y+(24*j),objHit);
            }
        }
        clicks+=0.5;
    }
}
if fireside == 3 
{
    for (i=1; i<=range; i++)
    {
        with(instance_create(x-(32*i),y,objHit))
        {
            for (j=1; j<=floor(clicks); j++)
            {
                instance_create(x+(16*j),y-(24*j),objHit);
                instance_create(x+(16*j),y+(24*j),objHit);
            }
        }
        clicks+=0.5;
    }
}
if fireside == 4 
{
    for (i=1; i<=range; i++)
    {
        with(instance_create(x-(16*i),y+(24*i),objHit))
        {
            for (j=1; j<=floor(clicks); j++)
            {
                instance_create(x-(16*j),y-(24*j),objHit);
                instance_create(x+(32*j),y,objHit);
            }
        }
        clicks+=0.5;
    }
}
if fireside == 5 
{
    for (i=1; i<=range; i++)
    {
        with(instance_create(x+(16*i),y+(24*i),objHit))
        {
            for (j=1; j<=floor(clicks); j++)
            {
                instance_create(x+(16*j),y-(24*j),objHit);
                instance_create(x-(32*j),y,objHit);
            }
        }
        clicks+=0.5;
    }
}
